import { DeviceType, DualShockInput } from "@babylonjs/core/DeviceInput/InputDevices/deviceEnums";
import { DeviceSource } from "@babylonjs/core/DeviceInput/InputDevices/deviceSource";
import { InputKeyStatus } from '../input-key-status';
import { DeviceInputKey } from "../device-information";


/**
 * @internal
 * 生成ps4手柄预设
 * @param device 设备源
 * @returns ps4手柄预设
 */
const DualShockPreset = (device: DeviceSource<DeviceType.DualShock>) => {
    return {
        Circle: new InputKeyStatus(DeviceInputKey.dualShockCircle, DualShockInput.Circle, device),
        Cross: new InputKeyStatus(DeviceInputKey.dualShockCross, DualShockInput.Cross, device),
        DPadDown: new InputKeyStatus(DeviceInputKey.dualShockDPadDown, DualShockInput.DPadDown, device),
        DPadLeft: new InputKeyStatus(DeviceInputKey.dualShockDPadLeft, DualShockInput.DPadLeft, device),
        DPadRight: new InputKeyStatus(DeviceInputKey.dualShockDPadRight, DualShockInput.DPadRight, device),
        DPadUp: new InputKeyStatus(DeviceInputKey.dualShockDPadUp, DualShockInput.DPadUp, device),
        Home: new InputKeyStatus(DeviceInputKey.dualShockHome, DualShockInput.Home, device),
        L1: new InputKeyStatus(DeviceInputKey.dualShockL1, DualShockInput.L1, device),
        L2: new InputKeyStatus(DeviceInputKey.dualShockL2, DualShockInput.L2, device),
        L3: new InputKeyStatus(DeviceInputKey.dualShockL3, DualShockInput.L3, device),
        LStickXAxis: new InputKeyStatus(DeviceInputKey.dualShockLStickXAxis, DualShockInput.LStickXAxis, device),
        LStickYAxis: new InputKeyStatus(DeviceInputKey.dualShockLStickYAxis, DualShockInput.LStickYAxis, device),
        Options: new InputKeyStatus(DeviceInputKey.dualShockOptions, DualShockInput.Options, device),
        R1: new InputKeyStatus(DeviceInputKey.dualShockR1, DualShockInput.R1, device),
        R2: new InputKeyStatus(DeviceInputKey.dualShockR2, DualShockInput.R2, device),
        R3: new InputKeyStatus(DeviceInputKey.dualShockR3, DualShockInput.R3, device),
        RStickXAxis: new InputKeyStatus(DeviceInputKey.dualShockRStickXAxis, DualShockInput.RStickXAxis, device),
        RStickYAxis: new InputKeyStatus(DeviceInputKey.dualShockRStickYAxis, DualShockInput.RStickYAxis, device),
        Share: new InputKeyStatus(DeviceInputKey.dualShockShare, DualShockInput.Share, device),
        Square: new InputKeyStatus(DeviceInputKey.dualShockSquare, DualShockInput.Square, device),
        TouchPad: new InputKeyStatus(DeviceInputKey.dualShockTouchPad, DualShockInput.TouchPad, device),
        Triangle: new InputKeyStatus(DeviceInputKey.dualShockTriangle, DualShockInput.Triangle, device),
    };
};


export { DualShockPreset };